package com.qf.index.gcrdo;

import cn.hutool.db.Db;
import cn.hutool.db.Entity;
import cn.hutool.db.ds.DSFactory;
import lombok.SneakyThrows;

import java.util.List;

/**
 * @Author: 葛成瑞
 * @Date: 2025/5/16 17:22
 */
public class SpTableTemp1 {
    @SneakyThrows
    public static void main(String[] args) {
        // 进行拆分表格如果表 word_and_code_set_map_new  的code_set 字段是多个拆成多个

        Db use = Db.use(DSFactory.get("localdb"));
        String table = "word_and_code_set_map_new";
        List<Entity> query = use.query("select * from " + table + " where tongyi_back like '%。%'");
        for (Entity entity : query) {
            String codeSet = entity.getStr("tongyi_back");
            if (codeSet.contains("。")) {
                Entity ins = new Entity();
                ins.set("tongyi_back", "不是");
                use.update(ins, Entity.create(table).set("id", entity.getStr("id")));
            }

        }

    }
}
